package com.whfc.openapi.api.face.controller;

import com.alibaba.fastjson.JSONObject;
import com.whfc.openapi.api.face.service.FaceGateSyncService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 海清人脸机回调接口
 * @author: xugcheng
 * @version: 1.0
 * @date: 2019/9/4 15:40
 */
@RestController
@RequestMapping("/open/api/faceGate/hq")
public class FaceGateHqController {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private FaceGateSyncService faceGateSyncService;

    @PostMapping("callback")
    public String identifyCallBack(@RequestBody String body) {
        JSONObject json = JSONObject.parseObject(body);
        logger.info("hq-callback:{},{}", json.getString("operator"), json.getString("info"));
        JSONObject ret = new JSONObject();
        ret.put("result", 1);
        ret.put("success", true);
        return ret.toString();
    }

}
